<?php
	$account = $_POST["account"];
	$jsonFile = file_get_contents("jsonData.json");
	$jsonFile = str_replace("\\x20", " ", $jsonFile);
	$jsonFile = str_replace("\\x3A", ":", $jsonFile);
	$jsonData = json_decode($jsonFile,true);
	foreach($jsonData["orders"] as $key=>$value){
		if($value["account"]==$account){
			array_splice($jsonData["orders"],$key,1);
		}
	}
	foreach($jsonData["orders"] as $key=>$value){
		$value["chargeTime"] = str_replace(" ", "\\x20", $value["chargeTime"]);
		$value["chargeTime"] = str_replace(":", "\\x3A", $value["chargeTime"]);
	}
	$jsonWriteData = json_encode($jsonData);

    $jsonFileObj=fopen("jsonData.json","w+");
    fwrite($jsonFileObj,$jsonWriteData);
    fclose($jsonFileObj);
    echo "删除账号:".$account."成功！";
?>